import { mapState } from 'vuex'
import themeJs from '@/theme/theme.js'
import shareHandler from '@/utils/shareHandler'

export default {
  install(Vue) {
    Vue.mixin({
      computed: {
        ...mapState({
          themeName: 'themeName'
        })
      },
      onShow() {
        themeJs.setTheme(this.themeName)
      },
      onShareAppMessage() {
        return shareHandler.shareInfo()
      }
    })
  }
}
